﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<head>
<%@include file="include.jsp"%>
<script type="text/javascript" src="jquery/jquery.md5.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript">
	$(function() {
		document.getElementById("username").focus();
	});
</script>
<style>
.bjf {
	background: url(images/bjf.jpg) repeat-x;
}

.dlf_03 {
	background: url(images/dlf_03.jpg) no-repeat;
	width: 636px;
	height: 283px;
}

.dlk {
	width: 300px;
	height: 150px;
	margin-left: 290px;
	margin-top: 2px;
}

.wenzi {
	font-size: 12px;
	font-family: "宋体";
}

.shurukuang {
	width: 180px;
	height: 20px;
	line-height: 20px;
	font-size: 12px;
	font-family: "宋体";
}

.shurukuang1 {
	width: 50px;
	height: 20px;
	line-height: 20px;
	font-size: 12px;
	font-family: "宋体";
	border: 1px solid #7F9DB9
}

.cuowu {
	width: 300px;
	height: 30px;
	font: "宋体";
	font-size: 12px;
	text-align: center;
	color: #FF4A4A;
	line-height: 30px;
}

.dlk a.test {
	display: block;
	width: 44px;
	height: 26px;
	background-image: url(images/dlf.jpg);
	background-repeat: no-repeat;
}

.dlk a.test:hover {
	background-image: url(images/dlfh.jpg);
}

.dlk a.test1 {
	display: block;
	width: 44px;
	height: 26px;
	background-image: url(images/czf.jpg);
	background-repeat: no-repeat;
}

.dlk a.test1:hover {
	background-image: url(images/czf.jpg);
}

.dlk .dla {
	border: none;
	background: transparent;
}

.ocx_style {
	border: 1px solid #7F9DB9;
	width: 155px;
	height: 20px;
}

.login_gerlyous {
	width: 178px;
	height: 20px;
	background: #FFFFFF;
	border: 1px solid #dddddd;
	color: #000000;
	line-height: 25px;
	padding-left: 0px
}
</style>
<title>互联网支付系统</title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
	class="bjf">
	<form  action="main.jsp" id="myform" name="myform" method="post">
		<table style="margin: 0 auto; padding: 0;" id="__01" width="1265"
			height="626" border="0" cellpadding="0" cellspacing="0"
			align="center">
			<tr>
				<td colspan="3" width="1265" height="181"></td>
			</tr>
			<tr>
				<td width="315" height="283"></td>
					<td class="dlf_03">
						<div class="dlk">
							<table width="100%" border="0" cellpadding="2">
								<tr>
									<td width="71" align="right" class="wenzi">用户名：</td>
									<td colspan="3">
										<label> 
		<!-- 用户名 -->						<input type="text"
													id="username" name="username" tabindex="1" maxlength='20'
													class="ocx_style" />
										</label>
									</td>
								</tr>
								<tr>
									<td align="right" class="wenzi">密&nbsp;码：</td>
									<td colspan="3">
										<label>
		<!-- 密码 -->						 	<input type="password"
												id="password" name="password" tabindex="1" maxlength='20'
												class="ocx_style" />
										</label>
									</td>
								</tr>
								<tr>
									<td align="right" class="wenzi">验证码：</td>
									<td width="59" >
		<!-- 验证码输入框 -->					<input id="verify" tabindex="3" name="verify"
												maxlength='4' type="text" value="" class="shurukuang1">
									</td>
										<td width="56" >
		<!-- 验证码图片 -->						<img name="randImage" class="swap" id="yzm"
									 			 width="64" height="20" border="1" align="top"/>
									 	</td>
										<td width="88">&nbsp;</td>
								</tr>
								<tr>
									<td></td>
									<td style="padding-top: 10px;">
									<a style="text-decoration: none;" href="javascript:void(0)"
									class="test">
								 		<input type="button" class="dla" id="but"
										style="cursor: pointer;height: 27px; width: 45px;" name="dd" value="" />
									</a></td>
									<td>&nbsp;</td>
									<td style="padding-top: 10px;">
									<a href="javascript:void(0)"
									class="test1">
									 <input type="reset" class="dla" name="dd"
										onclick="qc();" style="height: 27px; width: 45px;" value="" />
									</a></td>
								</tr>
							</table>
						</div>

					</td>
					<td width="314" height="283"></td>
				</tr>
			<tr>
					<td colspan="3" width="1265" height="162"></td>
				</tr>
		</table>
	</form>
</body>
<script type="text/javascript">
$("#verify").focus(function(){
	$("#yzm").attr("src","${ctx}/yanzhengma.img?now="+new Date());
})
  
$(".swap").click(function(){$("#yzm").attr("src","${ctx}/yanzhengma.img?now="+new Date())
    	})

var pattern = new RegExp("[~'!@#$%^&*()-+_=:]");
	$("#but").click(function() {
		$(".form-signin").submit(function(){
			return false
		})  
		if(pattern.test($("#username").val())){
			alert("用户名非法字符！");
			$("#username").attr("value","");
			$("#username").focus();
			return false;
		}
		if(pattern.test($("#password").val())){
			alert("密码非法字符！");
			$("#password").attr("value","");
			$("#password").focus();
			return false;
		}
		if($("#username").val()==="" ||$("#username").val()===null){
			alert("账号不能为空");
			return false;
		}
		if($("#password").val()==="" ||$("#username").val()===null){
			alert("密码不能为空");
			return false;
		}
		if($("#verify").val()==="" ||$("#username").val()===null){
			alert("验证码不能为空");
			return false;
		}
		var i=$("[type=password]").val()
		
		$("[type=password]").val($.md5($("[type=password]").val()))
		
		$.post(
			'${ctx}/login/checkUser.do',
			$("#myform").serialize(),
			function(msg) {
                   if(msg==1)
                	  location.href="${ctx}/login/main.do"
                      
                   else if(msg==2){
                      alert("用户名错误")
                	   $("#username").val("");
                	   $("#verify").val("");}
                   else if(msg==0){
                	   alert("密码错误")
                	   $("#password").val("");
                	   $("#verify").val("");}
                   else if(msg==3){
                	   alert("验证码错误")
                	   $("#verify").val("");}
			},
			'json'
		)

		

	})
</script>
</html>
